#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    bool checkRecord(string s) {
        int A=0;
        for(const char &ch:s) {
            if (ch == 'A') {
                A++;
            }
        }

        if(A<2 && s.find("LLL")==string::npos)
        {
            return true;
        }else{
            return false;
        }
    }
};

void test01(){
    string s;
    cin>>s;
    Solution ins;
    cout<<boolalpha<<ins.checkRecord(s)<<endl;
}

class SolutionOne {
public:
    int lengthOfLastWord(string s) {
        reverse(s.begin(),s.end());
        cout<<s<<endl;
        int start=0;
        for(int i=0;i<s.size();++i)
        {
            if(s[i]!=' ')
            {
                start=i;
                break;
            }
        }
        int pos=0;
        pos=s.find(' ',start);
        string temp=s.substr(start,pos-start);
        return temp.size();
    }
};

void test02(){
    string s;
    getline(cin,s);
    SolutionOne ins;
    cout<<ins.lengthOfLastWord(s)<<endl;
}

class SolutionTwo {
public:
    void reverseString(vector<char>& s) {
        reverse(s.begin(),s.end());
    }
};

void test03()
{
    vector<char> v;
    v.push_back('h');
    v.push_back('e');
    v.push_back('l');
    v.push_back('l');
    v.push_back('o');

    SolutionTwo ins;
    ins.reverseString(v);
   for(vector<char>::iterator it=v.begin();it!=v.end();++it){
       cout<<*it<<endl;
   }
}

int main()
{
    test03();
    // test02();
    // test01();
    return 0;
}
